﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FunctionList.aspx.cs" Inherits="Components_Permission_FunctionList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Danh sách chức năng</title>
    <link href="../../Template/Css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function getRadWindow() {
                if (window.radWindow) {
                    return window.radWindow;
                }
                if (window.frameElement && window.frameElement.radWindow) {
                    return window.frameElement.radWindow;
                }
                return null;
            }
            function OnClientClose(name, code, arg) {
                getRadWindow().close(arg);
            }
        
        </script>
    </telerik:RadCodeBlock>
     <telerik:RadScriptManager ID="ScriptManager2" runat="server" EnableTheming="True">
</telerik:RadScriptManager>
    <div>
   
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div>
          <%--  <div class="Title">
                Chi tiết chức năng
                <hr />
            </div>--%>
            <div class="wapper wapperMin">
                <div class="is1">
                    <div class="lst1">
                        Chức năng cấp trên</div>
                    <div class="textbox1">
                        <telerik:RadComboBox ID="cboFunctionParent" runat="server" OnSelectedIndexChanged="cboFunctionParent_SelectedIndexChanged"
                            TabIndex="2" AutoPostBack="true" />
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        Loại chức năng</div>
                    <div class="textbox1">
                        <telerik:RadComboBox ID="cboFunctionType" runat="server" 
                            OnSelectedIndexChanged="cboFunctionType_SelectedIndexChanged" TabIndex="1" AutoPostBack="true" />
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        Tên chức năng</div>
                    <div >
                        <telerik:RadTextBox ID="txtFunctionCode" runat="server" Enabled="false" 
                            Width="50px" />
                        <%--  <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="không được rỗng"
                            ControlToValidate="txtFunctionName"></asp:RequiredFieldValidator>--%>
                        <telerik:RadTextBox ID="txtFunctionName" runat="server" 
                            OnTextChanged="txtFunctionName_TextChanged" TabIndex="3" Width="160px" />
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        <%--    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="không được rỗng"
                            ControlToValidate="txtFunctionName"></asp:RequiredFieldValidator>--%>
                        Cấp chức năng</div>
                    <div class="textbox1">
                        <telerik:RadComboBox ID="cboFunctionLevel" runat="server" 
                            OnSelectedIndexChanged="cboFunctionLevel_SelectedIndexChanged" TabIndex="4">
                            <Items>
                                <telerik:RadComboBoxItem runat="server" Text="0" Value="0" />
                                <telerik:RadComboBoxItem runat="server" Text="1" Value="1" />
                            </Items>
                        </telerik:RadComboBox>
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        Nhóm chức năng</div>
                    <div class="textbox1">
                        <telerik:RadTextBox ID="txtGroupID" runat="server" OnTextChanged="txtGroupID_TextChanged"
                            TabIndex="5" />
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        Số thứ tự
                    </div>
                    <div class="textbox1">
                        <telerik:RadNumericTextBox ID="txtOderal" runat="server" OnTextChanged="txtOderal_TextChanged"
                            TabIndex="6">
                            <NumberFormat DecimalDigits="0" />
                        </telerik:RadNumericTextBox>
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        Đường dẫn chức năng
                    </div>
                    <div class="textbox1">
                        <telerik:RadTextBox ID="txtWebScreen" runat="server" Width="400" OnTextChanged="txtWebScreen_TextChanged"
                            TabIndex="7" />
                    </div>
                </div>
                <div class="is1">
                    <div class="lst1">
                        Chức năng
                    </div>
                    <div class="textbox1">
                        <asp:RadioButton ID="radSysFunction" runat="server" GroupName="ChucNang" 
                            TabIndex="8" oncheckedchanged="radSysFunction_CheckedChanged" />
                        <asp:Label ID="lblSystem" runat="server" Text="Hệ thống" CssClass="lbl1" />
                        <asp:RadioButton ID="radPublicFunction" runat="server" Checked="True" GroupName="ChucNang"
                            TabIndex="9" />
                        <asp:Label ID="lblAll" runat="server" Text="Chung" CssClass="lbl1" />
                    </div>
                </div>
                <div class="is1">
                    <div class="bt1">
                        <div>
                            <asp:Label ID="lblSuccess" runat="server" ForeColor="Blue"></asp:Label>
                            <asp:Label ID="lblResult" runat="server" ForeColor="Red"></asp:Label>
                        </div>
                        <asp:Button ID="btnSave" runat="server" Text="Lưu" CssClass="button" OnClick="btnSave_Click"
                            TabIndex="10" />
                        <asp:Button ID="btnDelete" runat="server" Text="Xóa" CssClass="button" OnClick="btnDelete_Click"
                            CausesValidation="false" TabIndex="11" />
                        <%--OnClientClick="return ConfirmOnDelete('Bạn có chắc xóa ?')"--%>
                        <asp:Button ID="btnNew" runat="server" Text="Thêm mới" CssClass="button" OnClick="btnNew_Click"
                            CausesValidation="false" TabIndex="12" />
                        <asp:Button ID="btnGotoList" runat="server" Text="Danh sách" CssClass="button" OnClick="btnGotoList_Click"
                            CausesValidation="false" TabIndex="13" />
                        <br />
                    </div>
                </div>
                <div class="grid wapperMin">
                    <telerik:RadGrid ID="grvData" runat="server" CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
                        HeaderStyle-HorizontalAlign="Center" AllowMultiRowSelection="True" OnItemCommand="grvData_ItemCommand"
                        OnNeedDataSource="grvData_NeedDataSource" HeaderStyle-BorderStyle="None">
                        <MasterTableView ShowHeader="true" AllowPaging="True" PageSize="20" NoMasterRecordsText="Không có dữ liệu."
                            ShowGroupFooter="true">
                            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="STT" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%# Container.ItemIndex + 1 %></ItemTemplate>
                                    <HeaderStyle Width="50px"/>
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn SortExpression="ID" HeaderText="Mã chức năng" ItemStyle-HorizontalAlign="Center"
                                    HeaderButtonType="TextButton" DataField="ID" UniqueName="ID" 
                                    Display="false" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="FunctionName" HeaderText="Tên chức năng"
                                    HeaderButtonType="TextButton" DataField="FunctionName" UniqueName="FunctionName">
                                    <HeaderStyle HorizontalAlign="Left"/>
                                    <ItemStyle />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="FunctionLevel" HeaderText="Cấp"
                                    HeaderButtonType="TextButton" DataField="FunctionLevel" UniqueName="FunctionLevel"
                                    ItemStyle-HorizontalAlign="Center" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="FunctionType" HeaderText="Loại"
                                    HeaderButtonType="TextButton" DataField="FunctionType" UniqueName="FunctionType"
                                    ItemStyle-HorizontalAlign="Center" Display="false" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="FunctionTypeName" HeaderText="Loại"
                                    HeaderButtonType="TextButton" DataField="FunctionTypeName" UniqueName="FunctionTypeName"
                                    ItemStyle-HorizontalAlign="Center" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="GroupID" HeaderText="Nhóm" HeaderButtonType="TextButton"
                                    DataField="GroupID" UniqueName="GroupID" 
                                    ItemStyle-HorizontalAlign="Center" >

                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>

                                  <telerik:GridBoundColumn SortExpression="ParentID" HeaderText="Chức năng cấp trên" HeaderButtonType="TextButton"
                                    DataField="ParentID" UniqueName="ParentID" 
                                    ItemStyle-HorizontalAlign="Center" >
                                      <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn3 column" 
                                    HeaderText="Chức năng hệ thống" UniqueName="TemplateColumn3">
                                    <ItemTemplate>
                                        <asp:CheckBox Enabled="false" ID="chkIsSysFunction" runat="server" Checked='<%# Eval("IsSysFunction")%>' />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn SortExpression="WebScreen" HeaderText=" Đường dẫn" HeaderButtonType="TextButton"
                                    DataField="WebScreen" UniqueName="WebScreen" 
                                    ItemStyle-HorizontalAlign="Left" >
                                    <HeaderStyle HorizontalAlign="Left" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="Ordinal" HeaderText="Thứ tự" HeaderButtonType="TextButton"
                                    DataField="Ordinal" UniqueName="Ordinal" 
                                    ItemStyle-HorizontalAlign="Center" 
                                    FilterControlAltText="Filter Ordinal column" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="Status" HeaderText="Trạng thái" HeaderButtonType="TextButton"
                                    DataField="Status" UniqueName="Status" ItemStyle-HorizontalAlign="Center" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                              
                                <telerik:GridTemplateColumn HeaderText="Sửa" Visible=false HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="lnkEditItem" CssClass="btnDelete" CommandArgument='<%# Eval("ID") %>'
                                            CommandName="EditItem" runat="server"></asp:Button>
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px"/>
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                  <telerik:GridTemplateColumn HeaderText="Xóa" Visible=false HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="lnkEditDel" CssClass="btnX" CommandArgument='<%# Eval("ID") %>'
                                            OnClientClick="return ConfirmOnDelete('Bạn chắc chắn muốn xóa?')" CommandName="EditDelItem"
                                            runat="server"></asp:Button>
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px"/>
                                      <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                    </telerik:RadGrid>
                </div>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
<div class="progressbar">
        <asp:UpdateProgress ID="up" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
            <img src="Template/Images/ajax-progress-bar.gif" alt="progressbar" />
            </ProgressTemplate>
        </asp:UpdateProgress>
 </div>
    </div>
    </form>
</body>
</html>
